﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Geometry;

namespace MyEngineExercise.我的扩展.信息类
{
    /// <summary>
    /// 保存项目红线信息（空间信息 + 非空间信息）,即行信息
    /// </summary>
    public class RedLineRowInfo
    {
        /// <summary>
        /// 红线多边形
        /// </summary>
        private IPolygon4 _polygon = null;
        /// <summary>
        /// 红线多边形
        /// </summary>
        public IPolygon4 Polygon { get { return _polygon; } }


        /// <summary>
        /// 地块名称
        /// </summary>
        private String _blockName = String.Empty;
        /// <summary>
        /// 地块名称
        /// </summary>
        public String BlockName { get { return _blockName; } }


        /// <summary>
        /// 图幅号
        /// </summary>
        private String _pageNum = String.Empty;
        /// <summary>
        /// 图幅号
        /// </summary>
        public String PageNum { get { return _pageNum; } }


        /// <summary>
        /// 土地用途
        /// </summary>
        private String _landUsage = String.Empty;
        /// <summary>
        /// 土地用途
        /// </summary>
        public String LandUsage { get { return _landUsage; } }


        /// <summary>
        /// 地块面积
        /// </summary>
        private Double _blockArea = 0;
        /// <summary>
        /// 地块面积
        /// </summary>
        public Double BlockArea { get { return _blockArea; } }


        /// <summary>
        /// 界址点数
        /// </summary>
        private Int32 _numberOfPoint = 0;
        /// <summary>
        /// 界址点数
        /// </summary>
        public Int32 NumberOfPoint { get { return _numberOfPoint;} }


        /// <summary>
        /// 地块编号
        /// </summary>
        private Int32 _blockId = 0;
        /// <summary>
        /// 地块编号
        /// </summary>
        public Int32 BlockId { get { return _blockId; } }


        /// <summary>
        /// 备注
        /// </summary>
        private String _remark = String.Empty;
        /// <summary>
        /// 备注
        /// </summary>
        public String Remark { get { return _remark; } }


        /// <summary>
        /// 地块几何类型
        /// </summary>
        private String _blockGeometryType = "面";
        /// <summary>
        /// 地块几何类型
        /// </summary>
        public String BlockGeometryType { get { return _blockGeometryType; } }



        /// <summary>
        /// 构造函数,保存用户输入的信息（项目红线）
        /// </summary>
        public RedLineRowInfo(IPolygon4 polygon, String blockName, String pageNum, String landUsage)
        {
            _polygon = polygon;
            _blockName = blockName;
            _pageNum = pageNum;
            _landUsage = landUsage;

            _blockArea = ((IArea)_polygon).Area/10000;//转换为公顷
            //_blockArea = ((IArea)_polygon).Area;
            _numberOfPoint = _polygon.PointCount();
            _blockId = 1;//为什么这里是1，不用考虑2个以上，因为是创建项目红线，默认只创建一个地块。合并要到批次用地
            _remark = _blockName;

        }
    }
}
